<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>系统后台 - {$Think.config.INTENDANT_NAME} - by HemaCMS</title>
    <link href="__INTENDANT__/css/admin_style.css" rel="stylesheet" />
    <script src="__COMMON__/jquery.js"></script>
    <script src="__COMMON__/jquery.cookie.js"></script>
    <script src="__COMMON__/jquery.idTabs.min.js"></script>
    <script src="__COMMON__/layer/layer.js"></script>
    <script src="__INTENDANT__/js/iteny.intendant.js"></script> <!-- 公共easyui JS -->
    <link href="__INTENDANT__/css/iteny.css" rel="stylesheet" />
</head>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
    <div class="nav">
  	    <ul class="idTabs cc">
          <li><a href="#siteset">站点设置</a></li>
          <li><a href="#email">邮箱设置</a></li>
          <li><a href="#adminset">后台设置</a></li>
        </ul>
  	</div>

<!-- <div>If you haven't checked out ...</div>
<div id="official">idTabs is only a simple ...</div> -->
    <div class="table_list">
      <form method='post'   id="myform" class="J_ajaxForm"  action="{:U('Site/setconfig')}">
      <input type="hidden" name="setconfig" value="setconfig" />
        <div id="siteset">
          <div class="h_a">站点配置</div>
          <div class="table_full">
            <table cellpadding=0 cellspacing=0 width="100%" class="table_form">
              <tr>
      	         <th width="140">站点名称:</th>
      	         <td>
                    <input type="text" class="input"  name="INTENDANT_NAME" value="{$Think.config.INTENDANT_NAME}" size="40">
                  </td>
              </tr>
              <tr>
        	       <th width="140">网站访问地址:</th>
        	       <td>
                    <input type="text" class="input"  name="siteurl" value="{$Site.WOSHI}" size="40"> <span class="gray"> 请以“/”结尾</span>
                  </td>
              </tr>
              <tr>
        	        <th width="140">附件访问地址:</th>
        	        <td>
                      <input type="text" class="input"  name="sitefileurl" value="{$Site.sitefileurl}" size="40"> <span class="gray"> 非上传目录设置</span>
                  </td>
              </tr>
              <tr>
        	         <th width="140">联系邮箱:</th>
        	         <td>
                      <input type="text" class="input"  name="siteemail" value="{$Site.siteemail}" size="40">
                   </td>
              </tr>
              <tr>
            	     <th width="140">网站关键字:</th>
            	     <td>
                      <input type="text" class="input"  name="sitekeywords" value="{$Site.sitekeywords}" size="40">
                   </td>
              </tr>
              <tr>
            	     <th width="140">网站简介:</th>
            	     <td>
                      <textarea name="siteinfo" style="width:380px; height:150px;">{$Site.siteinfo}</textarea>
                   </td>
              </tr>
              <tr>
            	     <th width="140">后台指定域名访问:</th>
            	     <td><select name="domainaccess" id="domainaccess" >
                        <option value="1" <if condition="$Site['domainaccess'] eq '1' "> selected</if>>开启指定域名访问</option>
                        <option value="0" <if condition="$Site['domainaccess'] eq '0' "> selected</if>>关闭指定域名访问</option>
                      </select> <span class="gray"> （该功能需要配合“域名绑定”模块使用，需要在域名绑定模块中添加域名！）</span></td>
              </tr>
              <tr>
            	     <th width="140">是否生成首页:</th>
            	     <td><select name="generate" id="generate" onChange="generates(this.value);">
                        <option value="1" <if condition="$Site['generate'] eq '1' "> selected</if>>生成静态</option>
                        <option value="0" <if condition="$Site['generate'] eq '0' "> selected</if>>不生成静态</option>
                      </select></td>
              </tr>
              <tr>
            	     <th width="140">首页模板:</th>
            	     <td><select name="indextp" id="indextp">
                        <volist name="indextp" id="vo">
                        <option value="{$vo}" <if condition="$Site['indextp'] eq $vo"> selected</if>>{$vo}</option>
                        </volist>
                      </select>
            	     span></td>
              </tr>
              <tr>
            	     <th width="140">验证码类型:</th>
            	     <td><select name="checkcode_type">
                     	<option value="0" <if condition="$Site['checkcode_type'] eq '0' "> selected</if>>数字字母混合</option>
                        <option value="1" <if condition="$Site['checkcode_type'] eq '1' "> selected</if>>纯数字</option>
                        <option value="2" <if condition="$Site['checkcode_type'] eq '2' "> selected</if>>纯字母</option>
                      </select></td>
              </tr>
            </table>
          </div>
        </div>
        <div id="email">
          <div class="h_a">邮箱设置</div>
          <div class="table_full">
            <table cellpadding=0 cellspacing=0 width="100%" class="table_form">
              <tr>
                <th width="140">你的邮箱:</th>
                <td>
                  <input type="text" class="input"  name="YOUR_EMAIL" value="{$Think.config.YOUR_EMAIL}" size="40">
                </td>
              </tr>
              <tr>
                <th width="140">你的邮箱密码:</th>
                <td>
                  <input type="text" class="input"  name="YOUR_EMAIL_PWD" value="{$Think.config.YOUR_EMAIL_PWD}" size="40">
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div id="adminset">
          <div class="h_a">后台设置</div>
          <div class="table_full">
            <table cellpadding=0 cellspacing=0 width="100%" class="table_form">
              <tr>
                <th width="140">站点名称:</th>
                <td>
                  <input type="text" class="input"  name="sitename" value="{$Site.WEBNAME}" size="40">
                </td>
              </tr>
            </table>
          </div>
        </div>
        <div class="btn_wrap">
          <div class="btn_wrap_pd">
            <button class="btn btn_submit mr10 J_ajax_submit_btn" type="submit">提交</button>
          </div>
        </div>
      </form>
    </div>
</div>
<script type="text/javascript">
$(function(){
    $('button.J_ajax_submit_btn').on('click', function (e) {
      e.preventDefault();
      var btn = $(this),
          form = btn.parents('form.J_ajaxForm');
          if(btn.attr("disabledSubmit")){
            btn.text('请勿重复提交...').prop('disabled', true).addClass('disabled');
            return false;
        }
      btn.attr("disabledSubmit",true);
        var param = form.serialize();
        $.ajax({
        url: form.attr('action'),
        dataType:'json',
        type:'POST',
        data:param,
        beforeSend: function(){
          layer.load(1);
        },
        success: function(data){
          layer.close(layer.load(1));
          if(!data.status){
            ITENY.alert('提示信息',data.info,2,'3000');

          } else {
            ITENY.alert('提示信息',data.info,1,'3000');
            setTimeout(function(){
                      ITENY.reloadPage(window);
                  },3000);

          }
        },
        error: function(data){
          layer.close(layer.load(1));
          ITENY.alert('提示信息',data.responseText,1,'3000');

        }
      });
    });
});
</script>
</body>
</html>